<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="common::common"></th:block>
</head>
<body class="childrenBody">
<form class="layui-form" style="width:80%;">
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">菜单名</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input userName"
                   lay-verify="required" name="moduleName" id="moduleName" th:value="${module?.moduleName}"
                   placeholder="请输入菜单名">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">菜单样式</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input userName"
                   name="moduleStyle" id="moduleStyle" th:value="${module?.moduleStyle}" placeholder="请输入菜单样式">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input userName"
                   name="orders" id="orders" placeholder="请输入排序值" th:value="${module?.orders}">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">权限码</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input userName"
                   lay-verify="required" name="optValue" id="optValue" placeholder="请输入菜单权限码"
                   th:value="${module?.optValue}">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">菜单级别</label>
        <div class="layui-input-block">
            <select name="grade">
                <option value="0" th:selected="${module?.grade==0}">一级菜单</option>
                <option value="1" th:selected="${module?.grade==1}">二级菜单</option>
                <option value="2" th:selected="${module?.grade==2}">三级菜单</option>
            </select>
        </div>
    </div>


    <div class="layui-form-item layui-row layui-col-xs12" th:if="${module?.grade==1}">
        <label class="layui-form-label">菜单url</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input userName"
                   lay-verify="required" name="url" id="url" placeholder="请输入菜单url" th:value="${module?.url}">
        </div>
    </div>


    <!--
       添加根级菜单
    -->
    <input name="parentId" type="hidden" th:value="${module?.parentId}"/>
    <input name="id" type="hidden" th:value="${module?.id}"/>
    <br/>
    <div class="layui-form-item layui-row layui-col-xs12">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-lg" lay-submit=""
                    lay-filter="updateModule">确认
            </button>
            <button class="layui-btn layui-btn-lg layui-btn-normal">取消</button>
        </div>
    </div>
</form>
<script type="text/javascript" th:src="@{/js/module/update.js}"></script>
</body>
</html>